package cn.chen.config;


import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import javax.validation.constraints.Email;
import java.util.Map;

@Configuration
//@配置类
@ConfigurationProperties(prefix = "prop")
//@表示将配置文件的属性注入到类的成员
@Data
@Validated
public class Prop {
    private String username;
    private Integer year;
    private String[] users;
    private String[] persons;
    private Map pass;
    private Map password;
    @Email(message = "邮箱格式不正确")
    private String email;
    @Value("${upload.path}")
    private String uploadPath;
    @Value("#{7*9}")
    private Integer result;
}
